package com.sysu.ooad.entity;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="t_teacher")
public class Teacher {
	
	private Integer id;
	private String name;
	private String password;
	private Course course;
	private Priviledge priviledge;
	
	public enum Priviledge {
		INSTRUCTOR, ASSISTANT
	}
	
	@Id
	@GeneratedValue
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	@ManyToOne
	@JoinColumn(name="course_id")
	public Course getCourse() {
		return course;
	}
	public void setCourse(Course course) {
		this.course = course;
	}
	
	@Enumerated(EnumType.STRING)
	public Priviledge getPriviledge() {
		return priviledge;
	}
	public void setPriviledge(Priviledge priviledge) {
		this.priviledge = priviledge;
	}
	
}
